//
//  DictionaryExtension.swift
//  ExtremeHealth
//
//  Created by Zhongkai Li 李忠凯 on 2018/9/29.
//  Copyright © 2018 GanDongKeJi. All rights reserved.
//

import Foundation

extension Dictionary where Key == String, Value: Any {
    func removeNil() -> [String: Any] {
        var result: [String: Any] = [:]
        self.forEach { (key, value) in
            // 剔除  空字符串 && nil
            if let value = value as? String, value.isEmpty {
                return
            } else {
                result[key] = value
            }
        }
        return result
    }
}
